package com.javasm.transfer.goods;

import com.javasm.domin.entity.goods.Activity;
import com.javasm.domin.entity.goods.GiftsToGoods;
import com.javasm.domin.entity.goods.GoodsAdjust;
import com.javasm.domin.entity.goods.Product;
import com.javasm.domin.vo.goods.ActivityVo;
import com.javasm.domin.vo.goods.GiftsToGoodsVo;
import com.javasm.domin.vo.goods.GoodsAdjustVo;
import com.javasm.mapper.goods.ProductMapper;
import com.javasm.transfer.base.BaseTransfer;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author：Drd
 * @Version：1.0
 * @Date：2022/1/18-11:14
 * @Since:jdk1.8
 * @Description:
 */
@Component
@RequiredArgsConstructor
public class ActivityTransfer extends BaseTransfer<Activity, ActivityVo> {



    public List<ActivityVo> setInfo(List<Activity> list) {
        List<ActivityVo> activityVos = super.toVO(list);
        for (int i = 0; i < activityVos.size(); i++) {
            Activity activity = list.get(i);
            ActivityVo activityVo = activityVos.get(i);
            if (activity.getApproveStatus() == null) {
                activityVo.setApproveStatus("未知");
            } else if (activity.getApproveStatus() == 0) {
                activityVo.setApproveStatus("待审核");
            } else if (activity.getApproveStatus() == 1) {
                activityVo.setApproveStatus("已审核");
            } else if (activity.getApproveStatus() == 2) {
                activityVo.setApproveStatus("审核不通过");
            } else {
                activityVo.setApproveStatus("未知");
            }
        }
        return activityVos;
    }
}
